package com.itheima.d5_map_traverse;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapTest2 {
    public static void main(String[] args) {
     //准备一个map集合
        Map<String,Double> map =new HashMap<>();
        map.put("a",100.1);
        map.put("a",110.2);
        map.put("b",200.3);
        map.put("c",300.5);
        map.put("d",400.2);
        System.out.println(map);

        Set<Map.Entry<String, Double>> entries = map.entrySet();
        for (Map.Entry<String, Double> entry : entries) {
            String key = entry.getKey();
            double value = entry.getValue();
            System.out.println(key + "====>" + value);
        }
    }
}
